package com.dao.hm;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.entity.Offerinfo;

public interface OfferinfoDAO extends CrudRepository<Offerinfo, Long>,JpaSpecificationExecutor<Offerinfo>{
	@Query("from Offerinfo o where o.logic=1")
	public Page<Offerinfo> queryNoCriteria(Pageable p);
	
	@Query("from Offerinfo o where o.logic=1 and o.toorder=?1")
	public Page<Offerinfo> queryFast(String toorder,Pageable p);
	
	@Query("from Offerinfo o where o.logic=1 and o.theme like ?1")
	public Page<Offerinfo> queryByTheme(String theme,Pageable p);

}
